package com.nanxun.service.Impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nanxun.constant.StoreConstants;
import com.nanxun.domain.Area;
import com.nanxun.mapper.AreaMapper;
import com.nanxun.service.AreaService;
import jakarta.annotation.Resource;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@CacheConfig(cacheNames ="com.nanxun.service.impl.AreaServiceImpl" )
public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements AreaService {

    @Resource
    private AreaMapper areaMapper;

    @Override
    @Cacheable(key = StoreConstants.ALL_AREA_KEY)
    public List<Area> queryAllAreaList() {
        return areaMapper.selectList(null);
    }
}
